import bsinRequest from '../utils/bsinRequest';

// 获取流程任务列表
export const getAllTask = (params: object) => {
  return bsinRequest('/getAllTask', {
    serviceName: 'BsinAdminProcessInstanceTaskService',
    methodName: 'getAllTask',
    bizParams: {
      ...params,
    },
  });
};

// 任务委派
export const delegateTask = (params: object) => {
  return bsinRequest('/delegateTask', {
    serviceName: 'BsinAdminProcessInstanceTaskService',
    methodName: 'delegateTask',
    bizParams: {
      ...params,
    },
  });
};

// 完成任务
export const resolveTask = (params: object) => {
  return bsinRequest('/resolveTask', {
    serviceName: 'BsinTaskService',
    methodName: 'resolve',
    bizParams: {
      ...params,
    },
  });
};

// 完成任务
export const completeTask = (params: object) => {
  return bsinRequest('/complete', {
    serviceName: 'BsinTaskService',
    methodName: 'complete',
    bizParams: {
      ...params,
    },
  });
};

// 完成任务
export const completeTaskWithForm = (params: object) => {
  return bsinRequest('/completeTaskWithForm', {
    serviceName: 'BsinTaskService',
    methodName: 'completeTaskWithForm',
    bizParams: {
      ...params,
    },
  });
};

// 完成任务
export const submitTaskFormData = (params: object) => {
  return bsinRequest('/submitTaskFormData', {
    serviceName: 'BsinFormRepositoryService',
    methodName: 'submitTaskFormData',
    bizParams: {
      ...params,
    },
  });
};

// 查询流程步骤
export const getHistoryActInst = (params: object) => {
  return bsinRequest('/getHistoryActInst', {
    serviceName: 'BsinAdminHistoryProcessInstService',
    methodName: 'getHistoryActInst',
    bizParams: {
      ...params,
    },
  });
};
